package com.tjzx.service;

import java.util.List;

import com.tjzx.dao.TVoteInfoDAO;
import com.tjzx.entity.TVoteInfo;

public class TVoteInfoService {
	private TVoteInfoDAO tVoteInfoDAO;

	public TVoteInfoDAO gettVoteInfoDAO() {
		return tVoteInfoDAO;
	}

	public void settVoteInfoDAO(TVoteInfoDAO tVoteInfoDAO) {
		this.tVoteInfoDAO = tVoteInfoDAO;
	}
	
	public TVoteInfo getVoteInfoById(Integer id) {
		return tVoteInfoDAO.findById(id);
	}

	public List<TVoteInfo> getAll() {
		return tVoteInfoDAO.findAll();
	}
	
	public void addVoteInfo(TVoteInfo tVoteInfo) {
		tVoteInfoDAO.save(tVoteInfo);
	}
	
	public void updateVoteInfo(TVoteInfo tVoteInfo) {
		tVoteInfoDAO.merge(tVoteInfo);
	}
	
	public void deleteVoteInfo(TVoteInfo tVoteInfo) {
		tVoteInfoDAO.delete(tVoteInfo);
	}
}
